<?php
/**
 * @CopyRight  (C)2012-2012 ThinkClouds Inc.
 * @WebSite    www.thinkclouds.net
 * @Author    Xu Xiangwu <xuxiangwu007@163.com>

 * @Update     2012.08.10
 * @Id         用户管理
**/
if(!defined('IN_PHPOE')) {
	exit('Access Denied');
}


class Mod_User{
	private static $db = NULL;
	private static $tpl = NUll;
	private static $urlpath	= NULL;
	private static $config = array();
	
	public static function timeout(){
		//return;
		
		$nowtime = time();
		$dtime = 900;
		
		//echo  $nowtime.'---'.$_SESSION['lgintime'];
		//echo  "=".($nowtime - $_SESSION['lgintime']);
		if($nowtime - $_SESSION['lgintime'] > $dtime)
		{
			$_SESSION['username'] = '';
			$_SESSION['userid'] = '';
			$_SESSION['lgintime'] = 0;
		}
		else
			$_SESSION['lgintime'] = $nowtime;
		
	}
	
	public static function userinfo($id){
		self::$db = $GLOBALS['db'];
		self::$tpl = $GLOBALS['tpl'];
		self::$urlpath = PATH_URL;
		self::$config = $GLOBALS['config'];
		$array=array();
		if($id != ""){
			$sql="SELECT * FROM oecms_user WHERE id='".$id."'";
			$array=self::$db->get_one($sql);
		}
	
		$array['url'] =$_SERVER["REQUEST_URI"];
		return $array;	
	}
}
?>